<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="../../vue.js"></script>
    <link rel="stylesheet" href="./a.css" />
</head>

<body>
    <div id="app">
        <h2 class="ismyname?'zzl':'haha'">{{ismyname}}</h2>
        <hr />
        <h2>{{myage}}</h2>
        <hr />
        <div :class="bjsolor?'red':'pink'">背景色</div>
        <hr />
        <div :class="isColor?'aqua':'coral'">循环变色</div>
        <hr />
        <img :src="imgs?'':'https://img1.baidu.com/it/u=1067185695,313237051&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=750'" alt="" />
        <hr />
        <div v-show="isshow">动态隐藏</div>
        <hr />
        <div v-if="isif">添加和删除</div>
        <hr />
        <ul>
            <li v-for="(item,index) in list">{{item}}--{{index}}</li>
        </ul>
        <button @click="djage()">改变</button>
    </div>
    <script>
        new Vue({
            el: "#app",
            data: {
                ismyname: "zzl",
                myage: 30,
                bjsolor: true,
                isColor: true,
                imgs: true,
                isshow: false,
                isif: true,
                list: ["a", "s", "d", "f", "g", "h", "j", "k", "l"],
            },
            methods: {
                djage() {
                    this.ismyname = "zl";
                    this.myage = 29;
                    this.bjsolor = !this.bjsolor;
                    this.isColor = !this.isColor;
                    this.imgs = !this.imgs;
                    this.isshow = !this.isshow;
                    this.isif = !this.isif;
                },
            },
        });
    </script>
</body>

</html>